<?php
    class Form extends CI_Model{
        function __construct(){
            // Call the Model constructor
            parent::__construct();
        }

        public function getList(){        
            $select = "SELECT * FROM forms 
              JOIN form_types ON form_types.form_type_name = forms.form_extends
              JOIN actions ON actions.action_id = forms.action_id
              JOIN action_types ON action_types.action_type_id = actions.action_type_id
              JOIN controllers ON controllers.controller_id = actions.controller_id
              ORDER BY controllers.controller_name, action_types.action_type_name, forms.form_order";
            $query = $this->db->query($select);
            return $query->result();
        }
    }  
?>